<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Plot Element</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Plot Element' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../intern.html">Inter Modules</a></li><li><a href="index.html">index</a></li><li><a href="index.html#3">Chapter 3: Elements</a></li><li><b>Plot Element</b></li></ul></div>
<p class="purpose">To write the Plot element (Pl) in the index.</p>

<ul class="toc"><li><a href="3-pe2.html#SP2">&#167;2. Table of Scenes</a></li></ul><hr class="tocbar">

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. </b>The mapping of time is on the one hand simpler than the mapping of space
since there is only one dimension, but on the other hand more complex since
scenes can be multiply present at the same instant of time (whereas rooms
cannot be multiply present at the same point in space). We resolve this
with a notation which takes a little bit of on-screen explanation, but
seems natural enough to learn in practice.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">PlotElement::render</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">PlotElement::render</span></span>:<br/>The Periodic Table - <a href="3-tpt.html#SP4">&#167;4</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">index_session</span><span class="plain-syntax"> *</span><span class="identifier-syntax">session</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">tree_inventory</span><span class="plain-syntax"> *</span><span class="identifier-syntax">inv</span><span class="plain-syntax"> = </span><a href="1-ia.html#SP10" class="function-link"><span class="function-syntax">Indexing::get_inventory</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax"> = </span><a href="1-ia.html#SP10" class="function-link"><span class="function-syntax">Indexing::get_tree</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">localisation_dictionary</span><span class="plain-syntax"> *</span><span class="identifier-syntax">LD</span><span class="plain-syntax"> = </span><a href="1-ia.html#SP10" class="function-link"><span class="function-syntax">Indexing::get_localisation</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">linked_list</span><span class="plain-syntax"> *</span><span class="identifier-syntax">L</span><span class="plain-syntax"> = </span><a href="1-ia.html#SP12" class="function-link"><span class="function-syntax">Indexing::get_list_of_scenes</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-pe2.html#SP1_1" class="named-paragraph-link"><span class="named-paragraph">Tabulate the scenes</span><span class="named-paragraph-number">1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-pe2.html#SP1_2" class="named-paragraph-link"><span class="named-paragraph">Show the legend for the scene table icons</span><span class="named-paragraph-number">1.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-pe2.html#SP1_3" class="named-paragraph-link"><span class="named-paragraph">Give details of each scene in turn</span><span class="named-paragraph-number">1.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP1_1" class="paragraph-anchor"></a><b>&#167;1.1. </b>The sorted ordering is used as-is later on, when we get to the details, but
for the tabulation it's refined further. First we have the start-of-play
scenes, in sorted order; then scenes with a condition for their beginning
(end 0), in sorted order; then scenes that don't, and which haven't been
covered as a result of one of the earlier ones, also in sorted order. (This
third category is usually empty except for scenes the author has forgotten
about and created but never made use of.)
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Tabulate the scenes</span><span class="named-paragraph-number">1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">simplified_scene</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">, </span><span class="reserved-syntax">simplified_scene</span><span class="plain-syntax">, </span><span class="identifier-syntax">L</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">ssc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">indexed_already</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">, </span><span class="reserved-syntax">simplified_scene</span><span class="plain-syntax">, </span><span class="identifier-syntax">L</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><a href="2-fs.html#SP5" class="function-link"><span class="function-syntax">FauxScenes::starts_at_start_of_play</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">)) || (</span><a href="2-fs.html#SP5" class="function-link"><span class="function-syntax">FauxScenes::is_entire_game</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">            </span><a href="3-pe2.html#SP2" class="function-link"><span class="function-syntax">PlotElement::index_from_scene</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">ssc</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="constant-syntax">START_OF_PLAY_END</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">, </span><span class="reserved-syntax">simplified_scene</span><span class="plain-syntax">, </span><span class="identifier-syntax">L</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><a href="2-fs.html#SP5" class="function-link"><span class="function-syntax">FauxScenes::starts_on_condition</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">)) &amp;&amp; (</span><a href="2-fs.html#SP5" class="function-link"><span class="function-syntax">FauxScenes::is_entire_game</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><a href="3-pe2.html#SP2" class="function-link"><span class="function-syntax">PlotElement::index_from_scene</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">ssc</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="constant-syntax">START_OF_PLAY_END</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">, </span><span class="reserved-syntax">simplified_scene</span><span class="plain-syntax">, </span><span class="identifier-syntax">L</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">indexed_already</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><a href="3-pe2.html#SP2" class="function-link"><span class="function-syntax">PlotElement::index_from_scene</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">ssc</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="constant-syntax">NEVER_HAPPENS_END</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-pe2.html#SP1">&#167;1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_2" class="paragraph-anchor"></a><b>&#167;1.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Show the legend for the scene table icons</span><span class="named-paragraph-number">1.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">HTML_OPEN</span><span class="plain-syntax">(</span><span class="string-syntax">"p"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Localisation::italic</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Pl.LegendHeading"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">": "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="3-pe2.html#SP3" class="function-link"><span class="function-syntax">PlotElement::scene_icon_legend</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="string-syntax">"WPB"</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Pl.WPBLegend"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"; "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="3-pe2.html#SP3" class="function-link"><span class="function-syntax">PlotElement::scene_icon_legend</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="string-syntax">"WhenC"</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Pl.WhenCLegend"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"; "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="3-pe2.html#SP3" class="function-link"><span class="function-syntax">PlotElement::scene_icon_legend</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="string-syntax">"Segue"</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Pl.SegueLegend"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"; "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="3-pe2.html#SP3" class="function-link"><span class="function-syntax">PlotElement::scene_icon_legend</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="string-syntax">"Simul"</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Pl.SimulLegend"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"; "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="3-pe2.html#SP3" class="function-link"><span class="function-syntax">PlotElement::scene_icon_legend</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="string-syntax">"WNever"</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Pl.WNeverLegend"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"; "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="3-pe2.html#SP3" class="function-link"><span class="function-syntax">PlotElement::scene_icon_legend</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="string-syntax">"ENever"</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Pl.ENeverLegend"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"; "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="3-pe2.html#SP3" class="function-link"><span class="function-syntax">PlotElement::scene_icon_legend</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="string-syntax">"Recurring"</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Pl.RecurringLegend"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">". "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Localisation::italic</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Pl.LegendNote"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">HTML_CLOSE</span><span class="plain-syntax">(</span><span class="string-syntax">"p"</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-pe2.html#SP1">&#167;1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_3" class="paragraph-anchor"></a><b>&#167;1.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Give details of each scene in turn</span><span class="named-paragraph-number">1.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="2-iu.html#SP5" class="function-link"><span class="function-syntax">IndexUtilities::anchor</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"SDETAILS"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">simplified_scene</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">, </span><span class="reserved-syntax">simplified_scene</span><span class="plain-syntax">, </span><span class="identifier-syntax">L</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">HTML_TAG</span><span class="plain-syntax">(</span><span class="string-syntax">"hr"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-pe2.html#SP1_3_1" class="named-paragraph-link"><span class="named-paragraph">Give details of a specific scene</span><span class="named-paragraph-number">1.3.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-pe2.html#SP1">&#167;1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_3_1" class="paragraph-anchor"></a><b>&#167;1.3.1. </b>The curious condition about end 1 here is to avoid printing "Ends: Never"
in cases where fancier ends for the scene exist, so that the scene can, in
fact, end.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Give details of a specific scene</span><span class="named-paragraph-number">1.3.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-pe2.html#SP1_3_1_1" class="named-paragraph-link"><span class="named-paragraph">Index the name and recurrence status of the scene</span><span class="named-paragraph-number">1.3.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="2-fs.html#SP5" class="function-link"><span class="function-syntax">FauxScenes::is_entire_game</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">)) </span><span class="named-paragraph-container code-font"><a href="3-pe2.html#SP1_3_1_2" class="named-paragraph-link"><span class="named-paragraph">Explain the Entire Game scene</span><span class="named-paragraph-number">1.3.1.2</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">end</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">end</span><span class="plain-syntax">&lt;</span><a href="2-fs.html#SP5" class="function-link"><span class="function-syntax">FauxScenes::no_ends</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">); </span><span class="identifier-syntax">end</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">end</span><span class="plain-syntax"> == </span><span class="constant-syntax">1</span><span class="plain-syntax">) &amp;&amp; (</span><a href="2-fs.html#SP5" class="function-link"><span class="function-syntax">FauxScenes::no_ends</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">2</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">            (</span><a href="2-fs.html#SP6" class="function-link"><span class="function-syntax">FauxScenes::has_anchor_condition</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">ends</span><span class="plain-syntax">[1]) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">            (</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">ends</span><span class="plain-syntax">[1]-&gt;</span><span class="element-syntax">anchor_connectors</span><span class="plain-syntax">==</span><span class="identifier-syntax">NULL</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">continue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-pe2.html#SP1_3_1_4" class="named-paragraph-link"><span class="named-paragraph">Index the conditions for this scene end to occur</span><span class="named-paragraph-number">1.3.1.4</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-pe2.html#SP1_3_1_5" class="named-paragraph-link"><span class="named-paragraph">Index the rules which apply when this scene end occurs</span><span class="named-paragraph-number">1.3.1.5</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">end</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="3-pe2.html#SP1_3_1_3" class="named-paragraph-link"><span class="named-paragraph">Index the rules which apply during this scene</span><span class="named-paragraph-number">1.3.1.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-pe2.html#SP1_3">&#167;1.3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_3_1_1" class="paragraph-anchor"></a><b>&#167;1.3.1.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Index the name and recurrence status of the scene</span><span class="named-paragraph-number">1.3.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">HTML::open_indented_p</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">, </span><span class="string-syntax">"hanging"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="2-iu.html#SP5" class="function-link"><span class="function-syntax">IndexUtilities::anchor_numbered</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">ssc</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Localisation::bold_t</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Pl.SceneName"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Metadata::required_textual</span><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">pack</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"^name"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><a href="2-iu.html#SP2" class="function-link"><span class="function-syntax">IndexUtilities::link_package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">ssc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">pack</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="2-fs.html#SP5" class="function-link"><span class="function-syntax">FauxScenes::recurs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"&amp;nbsp;&amp;nbsp;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Localisation::italic</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Pl.Recurring"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">HTML_CLOSE</span><span class="plain-syntax">(</span><span class="string-syntax">"p"</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-pe2.html#SP1_3_1">&#167;1.3.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_3_1_2" class="paragraph-anchor"></a><b>&#167;1.3.1.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Explain the Entire Game scene</span><span class="named-paragraph-number">1.3.1.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">HTML::open_indented_p</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">, </span><span class="string-syntax">"tight"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Localisation::roman</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Pl.EntireGame"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">HTML_CLOSE</span><span class="plain-syntax">(</span><span class="string-syntax">"p"</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-pe2.html#SP1_3_1">&#167;1.3.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_3_1_3" class="paragraph-anchor"></a><b>&#167;1.3.1.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Index the rules which apply during this scene</span><span class="named-paragraph-number">1.3.1.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">rbc</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pack</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER_INVENTORY_PACKAGES</span><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">rulebook_nodes</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="2-ir.html#SP6" class="function-link"><span class="function-syntax">IndexRules::is_contextually_empty</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">pack</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><a href="2-ir.html#SP3" class="function-link"><span class="function-syntax">IndexRules::scene_context</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">)) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">rbc</span><span class="plain-syntax">++ == </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">HTML::open_indented_p</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">, </span><span class="string-syntax">"hanging"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">Localisation::italic</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Pl.During"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">HTML_CLOSE</span><span class="plain-syntax">(</span><span class="string-syntax">"p"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">HTML::open_indented_p</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="constant-syntax">2</span><span class="plain-syntax">, </span><span class="string-syntax">"hanging"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"&lt;i&gt;%S&lt;/i&gt;"</span><span class="plain-syntax">, </span><span class="identifier-syntax">Metadata::required_textual</span><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"^printed_name"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">HTML_CLOSE</span><span class="plain-syntax">(</span><span class="string-syntax">"p"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="2-ir.html#SP9" class="function-link"><span class="function-syntax">IndexRules::rulebook_list</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">pack</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">""</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><a href="2-ir.html#SP3" class="function-link"><span class="function-syntax">IndexRules::scene_context</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">), </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-pe2.html#SP1_3_1">&#167;1.3.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_3_1_4" class="paragraph-anchor"></a><b>&#167;1.3.1.4. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Index the conditions for this scene end to occur</span><span class="named-paragraph-number">1.3.1.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">HTML::open_indented_p</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">, </span><span class="string-syntax">"hanging"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">end</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="identifier-syntax">Localisation::italic</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Pl.BeginsWhen"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">end</span><span class="plain-syntax"> == </span><span class="constant-syntax">1</span><span class="plain-syntax">) </span><span class="identifier-syntax">Localisation::italic</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Pl.EndsWhen"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">end</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">2</span><span class="plain-syntax">) </span><span class="identifier-syntax">Localisation::italic_t</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Pl.EndsUnusuallyWhen"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><a href="2-fs.html#SP6" class="function-link"><span class="function-syntax">FauxScenes::end_name</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">ends</span><span class="plain-syntax">[</span><span class="identifier-syntax">end</span><span class="plain-syntax">]));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">count</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-pe2.html#SP1_3_1_4_1" class="named-paragraph-link"><span class="named-paragraph">Index the play-begins condition</span><span class="named-paragraph-number">1.3.1.4.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-pe2.html#SP1_3_1_4_2" class="named-paragraph-link"><span class="named-paragraph">Index the I7 condition for a scene to end</span><span class="named-paragraph-number">1.3.1.4.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-pe2.html#SP1_3_1_4_3" class="named-paragraph-link"><span class="named-paragraph">Index connections to other scene ends</span><span class="named-paragraph-number">1.3.1.4.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">count</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="identifier-syntax">Localisation::bold</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Pl.Never"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">HTML_CLOSE</span><span class="plain-syntax">(</span><span class="string-syntax">"p"</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-pe2.html#SP1_3_1">&#167;1.3.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_3_1_4_1" class="paragraph-anchor"></a><b>&#167;1.3.1.4.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Index the play-begins condition</span><span class="named-paragraph-number">1.3.1.4.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">end</span><span class="plain-syntax">==0) &amp;&amp; (</span><a href="2-fs.html#SP5" class="function-link"><span class="function-syntax">FauxScenes::starts_at_start_of_play</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">))) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">count</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">HTML_TAG</span><span class="plain-syntax">(</span><span class="string-syntax">"br"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Localisation::italic</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Pl.OrWhen"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"&lt;b&gt;play begins&lt;/b&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">count</span><span class="plain-syntax">++;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-pe2.html#SP1_3_1_4">&#167;1.3.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_3_1_4_2" class="paragraph-anchor"></a><b>&#167;1.3.1.4.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Index the I7 condition for a scene to end</span><span class="named-paragraph-number">1.3.1.4.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="2-fs.html#SP6" class="function-link"><span class="function-syntax">FauxScenes::has_anchor_condition</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">ends</span><span class="plain-syntax">[</span><span class="identifier-syntax">end</span><span class="plain-syntax">])) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">count</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">HTML_TAG</span><span class="plain-syntax">(</span><span class="string-syntax">"br"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Localisation::italic</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Pl.OrWhen"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%S"</span><span class="plain-syntax">, </span><a href="2-fs.html#SP6" class="function-link"><span class="function-syntax">FauxScenes::anchor_condition</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">ends</span><span class="plain-syntax">[</span><span class="identifier-syntax">end</span><span class="plain-syntax">]));</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">at</span><span class="plain-syntax"> = </span><a href="2-fs.html#SP6" class="function-link"><span class="function-syntax">FauxScenes::anchor_condition_set_at</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">ends</span><span class="plain-syntax">[</span><span class="identifier-syntax">end</span><span class="plain-syntax">]);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">at</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><a href="2-iu.html#SP2" class="function-link"><span class="function-syntax">IndexUtilities::link</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">at</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">count</span><span class="plain-syntax">++;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-pe2.html#SP1_3_1_4">&#167;1.3.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_3_1_4_3" class="paragraph-anchor"></a><b>&#167;1.3.1.4.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Index connections to other scene ends</span><span class="named-paragraph-number">1.3.1.4.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">simplified_connector</span><span class="plain-syntax"> *</span><span class="identifier-syntax">scon</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ssc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">ends</span><span class="plain-syntax">[</span><span class="identifier-syntax">end</span><span class="plain-syntax">]-&gt;</span><span class="element-syntax">anchor_connectors</span><span class="plain-syntax">; </span><span class="identifier-syntax">scon</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">scon</span><span class="plain-syntax">=</span><span class="identifier-syntax">scon</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">count</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">HTML_TAG</span><span class="plain-syntax">(</span><span class="string-syntax">"br"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Localisation::italic</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Pl.OrWhen"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">simplified_scene</span><span class="plain-syntax"> *</span><span class="identifier-syntax">to_ssc</span><span class="plain-syntax"> = </span><a href="2-fs.html#SP7" class="function-link"><span class="function-syntax">FauxScenes::connects_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">scon</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">NW</span><span class="plain-syntax"> = </span><a href="2-fs.html#SP5" class="function-link"><span class="function-syntax">FauxScenes::scene_name</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">to_ssc</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"&lt;b&gt;%S&lt;/b&gt; &lt;i&gt;%s&lt;/i&gt;"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NW</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            (</span><a href="2-fs.html#SP7" class="function-link"><span class="function-syntax">FauxScenes::scon_end</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">scon</span><span class="plain-syntax">)==0)?</span><span class="string-syntax">"begins"</span><span class="plain-syntax">:</span><span class="string-syntax">"ends"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="2-fs.html#SP7" class="function-link"><span class="function-syntax">FauxScenes::scon_end</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">scon</span><span class="plain-syntax">) &gt;= </span><span class="constant-syntax">2</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" %S"</span><span class="plain-syntax">, </span><a href="2-fs.html#SP6" class="function-link"><span class="function-syntax">FauxScenes::end_name</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">to_ssc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">ends</span><span class="plain-syntax">[</span><a href="2-fs.html#SP7" class="function-link"><span class="function-syntax">FauxScenes::scon_end</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">scon</span><span class="plain-syntax">)]));</span>
<span class="plain-syntax">        </span><a href="2-iu.html#SP2" class="function-link"><span class="function-syntax">IndexUtilities::link</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><a href="2-fs.html#SP7" class="function-link"><span class="function-syntax">FauxScenes::scon_at</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">scon</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">count</span><span class="plain-syntax">++;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-pe2.html#SP1_3_1_4">&#167;1.3.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP1_3_1_5" class="paragraph-anchor"></a><b>&#167;1.3.1.5. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Index the rules which apply when this scene end occurs</span><span class="named-paragraph-number">1.3.1.5</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">rb</span><span class="plain-syntax"> = </span><a href="2-fs.html#SP6" class="function-link"><span class="function-syntax">FauxScenes::end_rulebook</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">ends</span><span class="plain-syntax">[</span><span class="identifier-syntax">end</span><span class="plain-syntax">]);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">rb_pack</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterPackage::container</span><span class="plain-syntax">(</span><span class="identifier-syntax">rb</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">definition</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="2-ir.html#SP7" class="function-link"><span class="function-syntax">IndexRules::is_empty</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">rb_pack</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">HTML::open_indented_p</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">, </span><span class="string-syntax">"hanging"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Localisation::italic</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Pl.WhatHappens"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">":"</span><span class="plain-syntax">); </span><span class="identifier-syntax">HTML_CLOSE</span><span class="plain-syntax">(</span><span class="string-syntax">"p"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="2-ir.html#SP9" class="function-link"><span class="function-syntax">IndexRules::rulebook_list</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">rb_pack</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">""</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><a href="2-ir.html#SP4" class="function-link"><span class="function-syntax">IndexRules::no_rule_context</span></a><span class="plain-syntax">(), </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-pe2.html#SP1_3_1">&#167;1.3.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. Table of Scenes.</b>We finally return to the table of scenes. The following is recursive, and
is called at the top level for each scene in turn which starts at the start
of play (see above).
</p>

<p class="commentary">A scene entry can be arrived at in three ways: through one of its ends, in
which case <span class="extract"><span class="extract-syntax">end</span></span> is the number (0 for begins, 1 for standard ends, and so on),
or through being already active at the start of play, or through being covered
in the index even though it never happens in play. This means we need two
additional <span class="extract"><span class="extract-syntax">end</span></span> numbers. They are only ever used at the top level, that is,
on the initial call when <span class="extract"><span class="extract-syntax">depth</span></span> is 0.
</p>

<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="constant-syntax">START_OF_PLAY_END</span><span class="plain-syntax"> -1</span>
<span class="definition-keyword">define</span> <span class="constant-syntax">NEVER_HAPPENS_END</span><span class="plain-syntax"> -2</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">PlotElement::index_from_scene</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">PlotElement::index_from_scene</span></span>:<br/><a href="3-pe2.html#SP1_1">&#167;1.1</a>, <a href="3-pe2.html#SP2_5">&#167;2.5</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">simplified_scene</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">depth</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">end</span><span class="plain-syntax">, </span><span class="reserved-syntax">simplified_scene</span><span class="plain-syntax"> *</span><span class="identifier-syntax">sc_from</span><span class="plain-syntax">, </span><span class="reserved-syntax">index_session</span><span class="plain-syntax"> *</span><span class="identifier-syntax">session</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">linked_list</span><span class="plain-syntax"> *</span><span class="identifier-syntax">L</span><span class="plain-syntax"> = </span><a href="1-ia.html#SP12" class="function-link"><span class="function-syntax">Indexing::get_list_of_scenes</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">HTML::open_indented_p</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">depth</span><span class="plain-syntax">+1, </span><span class="string-syntax">"tight"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-pe2.html#SP2_1" class="named-paragraph-link"><span class="named-paragraph">Indicate the route by which this scene was reached</span><span class="named-paragraph-number">2.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-pe2.html#SP2_2" class="named-paragraph-link"><span class="named-paragraph">Name the scene in the table, italicised if we've seen it already</span><span class="named-paragraph-number">2.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">indexed_already</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-pe2.html#SP2_3" class="named-paragraph-link"><span class="named-paragraph">Show the never-ends icon if appropriate</span><span class="named-paragraph-number">2.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-pe2.html#SP2_4" class="named-paragraph-link"><span class="named-paragraph">Show the recurring icon if appropriate</span><span class="named-paragraph-number">2.4</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">HTML_CLOSE</span><span class="plain-syntax">(</span><span class="string-syntax">"p"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">indexed_already</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ssc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">indexed_already</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-pe2.html#SP2_5" class="named-paragraph-link"><span class="named-paragraph">Indent to tabulate other scenes connected to the ends of this one</span><span class="named-paragraph-number">2.5</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP2_1" class="paragraph-anchor"></a><b>&#167;2.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Indicate the route by which this scene was reached</span><span class="named-paragraph-number">2.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">switch</span><span class="plain-syntax">(</span><span class="identifier-syntax">end</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="constant-syntax">0</span><span class="plain-syntax">: </span><a href="3-pe2.html#SP3" class="function-link"><span class="function-syntax">PlotElement::scene_icon</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="string-syntax">"Simul"</span><span class="plain-syntax">); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="constant-syntax">1</span><span class="plain-syntax">: </span><a href="3-pe2.html#SP3" class="function-link"><span class="function-syntax">PlotElement::scene_icon</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="string-syntax">"Segue"</span><span class="plain-syntax">); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">START_OF_PLAY_END:</span><span class="plain-syntax"> </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">NEVER_HAPPENS_END:</span><span class="plain-syntax"> </span><a href="3-pe2.html#SP3" class="function-link"><span class="function-syntax">PlotElement::scene_icon</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="string-syntax">"WNever"</span><span class="plain-syntax">); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">default:</span>
<span class="plain-syntax">            </span><a href="3-pe2.html#SP3" class="function-link"><span class="function-syntax">PlotElement::scene_icon</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="string-syntax">"Segue"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"[ends %S]&amp;nbsp;"</span><span class="plain-syntax">, </span><a href="2-fs.html#SP6" class="function-link"><span class="function-syntax">FauxScenes::end_name</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">sc_from</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">ends</span><span class="plain-syntax">[</span><span class="identifier-syntax">end</span><span class="plain-syntax">])); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">indexed_already</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">depth</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="2-fs.html#SP5" class="function-link"><span class="function-syntax">FauxScenes::is_entire_game</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">)) </span><a href="3-pe2.html#SP3" class="function-link"><span class="function-syntax">PlotElement::scene_icon</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="string-syntax">"WPB"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="2-fs.html#SP5" class="function-link"><span class="function-syntax">FauxScenes::starts_on_condition</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">)) </span><a href="3-pe2.html#SP3" class="function-link"><span class="function-syntax">PlotElement::scene_icon</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="string-syntax">"WhenC"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="2-fs.html#SP5" class="function-link"><span class="function-syntax">FauxScenes::starts_at_start_of_play</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">)) </span><a href="3-pe2.html#SP3" class="function-link"><span class="function-syntax">PlotElement::scene_icon</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="string-syntax">"WPB"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-pe2.html#SP2">&#167;2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_2" class="paragraph-anchor"></a><b>&#167;2.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Name the scene in the table, italicised if we've seen it already</span><span class="named-paragraph-number">2.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">indexed_already</span><span class="plain-syntax">) </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"&lt;i&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%S"</span><span class="plain-syntax">, </span><span class="identifier-syntax">Metadata::required_textual</span><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">pack</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"^name"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">indexed_already</span><span class="plain-syntax">) </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"&lt;/i&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><a href="2-iu.html#SP5" class="function-link"><span class="function-syntax">IndexUtilities::below_link_numbered</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">ssc</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-pe2.html#SP2">&#167;2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_3" class="paragraph-anchor"></a><b>&#167;2.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Show the never-ends icon if appropriate</span><span class="named-paragraph-number">2.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="2-fs.html#SP5" class="function-link"><span class="function-syntax">FauxScenes::never_ends</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><a href="3-pe2.html#SP3" class="function-link"><span class="function-syntax">PlotElement::scene_icon_append</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="string-syntax">"ENever"</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-pe2.html#SP2">&#167;2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_4" class="paragraph-anchor"></a><b>&#167;2.4. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Show the recurring icon if appropriate</span><span class="named-paragraph-number">2.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="2-fs.html#SP5" class="function-link"><span class="function-syntax">FauxScenes::recurs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ssc</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><a href="3-pe2.html#SP3" class="function-link"><span class="function-syntax">PlotElement::scene_icon_append</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="string-syntax">"Recurring"</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-pe2.html#SP2">&#167;2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_5" class="paragraph-anchor"></a><b>&#167;2.5. </b>And this is where the routine recurses, so that consequent scenes are
tabulated underneath the present one, indented one step further in (since
indentation is coupled to <span class="extract"><span class="extract-syntax">depth</span></span>). First we recurse to scenes which end when
this one does; then to scenes which begin when this one ends.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Indent to tabulate other scenes connected to the ends of this one</span><span class="named-paragraph-number">2.5</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">simplified_scene</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ssc2</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">ssc2</span><span class="plain-syntax">, </span><span class="reserved-syntax">simplified_scene</span><span class="plain-syntax">, </span><span class="identifier-syntax">L</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">simplified_connector</span><span class="plain-syntax"> *</span><span class="identifier-syntax">scon</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ssc2</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">ends</span><span class="plain-syntax">[0]-&gt;</span><span class="element-syntax">anchor_connectors</span><span class="plain-syntax">; </span><span class="identifier-syntax">scon</span><span class="plain-syntax">; </span><span class="identifier-syntax">scon</span><span class="plain-syntax">=</span><span class="identifier-syntax">scon</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><a href="2-fs.html#SP7" class="function-link"><span class="function-syntax">FauxScenes::connects_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">scon</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">) == </span><span class="identifier-syntax">ssc</span><span class="plain-syntax">) &amp;&amp; (</span><a href="2-fs.html#SP7" class="function-link"><span class="function-syntax">FauxScenes::scon_end</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">scon</span><span class="plain-syntax">) &gt;= </span><span class="constant-syntax">1</span><span class="plain-syntax">))</span>
<span class="plain-syntax">                </span><a href="3-pe2.html#SP2" class="function-link"><span class="function-syntax">PlotElement::index_from_scene</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">ssc2</span><span class="plain-syntax">, </span><span class="identifier-syntax">depth</span><span class="plain-syntax"> + </span><span class="constant-syntax">1</span><span class="plain-syntax">, </span><a href="2-fs.html#SP7" class="function-link"><span class="function-syntax">FauxScenes::scon_end</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">scon</span><span class="plain-syntax">), </span><span class="identifier-syntax">ssc</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">ssc2</span><span class="plain-syntax">, </span><span class="reserved-syntax">simplified_scene</span><span class="plain-syntax">, </span><span class="identifier-syntax">L</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">simplified_connector</span><span class="plain-syntax"> *</span><span class="identifier-syntax">scon</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ssc2</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">ends</span><span class="plain-syntax">[0]-&gt;</span><span class="element-syntax">anchor_connectors</span><span class="plain-syntax">; </span><span class="identifier-syntax">scon</span><span class="plain-syntax">; </span><span class="identifier-syntax">scon</span><span class="plain-syntax">=</span><span class="identifier-syntax">scon</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><a href="2-fs.html#SP7" class="function-link"><span class="function-syntax">FauxScenes::connects_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">scon</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">) == </span><span class="identifier-syntax">ssc</span><span class="plain-syntax">) &amp;&amp; (</span><a href="2-fs.html#SP7" class="function-link"><span class="function-syntax">FauxScenes::scon_end</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">scon</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">))</span>
<span class="plain-syntax">                </span><a href="3-pe2.html#SP2" class="function-link"><span class="function-syntax">PlotElement::index_from_scene</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">ssc2</span><span class="plain-syntax">, </span><span class="identifier-syntax">depth</span><span class="plain-syntax">, </span><a href="2-fs.html#SP7" class="function-link"><span class="function-syntax">FauxScenes::scon_end</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">scon</span><span class="plain-syntax">), </span><span class="identifier-syntax">ssc</span><span class="plain-syntax">, </span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-pe2.html#SP2">&#167;2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. </b>We have been using:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">PlotElement::scene_icon</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">PlotElement::scene_icon</span></span>:<br/><a href="3-pe2.html#SP2_1">&#167;2.1</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">char</span><span class="plain-syntax"> *</span><span class="identifier-syntax">si</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><a href="3-pe2.html#SP3" class="function-link"><span class="function-syntax">PlotElement::scene_icon_unspaced</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">si</span><span class="plain-syntax">); </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"&amp;nbsp;&amp;nbsp;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">PlotElement::scene_icon_append</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">PlotElement::scene_icon_append</span></span>:<br/><a href="3-pe2.html#SP2_3">&#167;2.3</a>, <a href="3-pe2.html#SP2_4">&#167;2.4</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">char</span><span class="plain-syntax"> *</span><span class="identifier-syntax">si</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"&amp;nbsp;&amp;nbsp;"</span><span class="plain-syntax">); </span><a href="3-pe2.html#SP3" class="function-link"><span class="function-syntax">PlotElement::scene_icon_unspaced</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">si</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">PlotElement::scene_icon_legend</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">PlotElement::scene_icon_legend</span></span>:<br/><a href="3-pe2.html#SP1_2">&#167;1.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">char</span><span class="plain-syntax"> *</span><span class="identifier-syntax">si</span><span class="plain-syntax">, </span><span class="identifier-syntax">localisation_dictionary</span><span class="plain-syntax"> *</span><span class="identifier-syntax">LD</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">gloss</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><a href="3-pe2.html#SP3" class="function-link"><span class="function-syntax">PlotElement::scene_icon_unspaced</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">si</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"&amp;nbsp;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Localisation::italic</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">gloss</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">PlotElement::scene_icon_unspaced</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">char</span><span class="plain-syntax"> *</span><span class="identifier-syntax">si</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">HTML_TAG_WITH</span><span class="plain-syntax">(</span><span class="string-syntax">"img"</span><span class="plain-syntax">, </span><span class="string-syntax">"border=0 src=inform:/scene_icons/%s.png"</span><span class="plain-syntax">, </span><span class="identifier-syntax">si</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="3-pe.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresschapter"><a href="1-im.html">1</a></li><li class="progresschapter"><a href="2-il.html">2</a></li><li class="progresscurrentchapter">3</li><li class="progresssection"><a href="3-tpt.html">tpt</a></li><li class="progresssection"><a href="3-ae.html">ae</a></li><li class="progresssection"><a href="3-ae2.html">ae2</a></li><li class="progresssection"><a href="3-be.html">be</a></li><li class="progresssection"><a href="3-ce.html">ce</a></li><li class="progresssection"><a href="3-ce2.html">ce2</a></li><li class="progresssection"><a href="3-ce3.html">ce3</a></li><li class="progresssection"><a href="3-ce4.html">ce4</a></li><li class="progresssection"><a href="3-ee.html">ee</a></li><li class="progresssection"><a href="3-ee2.html">ee2</a></li><li class="progresssection"><a href="3-fe.html">fe</a></li><li class="progresssection"><a href="3-ge.html">ge</a></li><li class="progresssection"><a href="3-ge2.html">ge2</a></li><li class="progresssection"><a href="3-ie.html">ie</a></li><li class="progresssection"><a href="3-le.html">le</a></li><li class="progresssection"><a href="3-me.html">me</a></li><li class="progresssection"><a href="3-pe.html">pe</a></li><li class="progresscurrent">pe2</li><li class="progresssection"><a href="3-re.html">re</a></li><li class="progresssection"><a href="3-rfse.html">rfse</a></li><li class="progresssection"><a href="3-se.html">se</a></li><li class="progresssection"><a href="3-te.html">te</a></li><li class="progresssection"><a href="3-te2.html">te2</a></li><li class="progresssection"><a href="3-ve.html">ve</a></li><li class="progresssection"><a href="3-ve2.html">ve2</a></li><li class="progresschapter"><a href="4-mc.html">4</a></li><li class="progressnext"><a href="3-re.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

